From: =?utf-8?q?Ferenc_W=C3=A1gner?= <wferi@debian.org>
Date: Mon, 19 Dec 2016 21:36:05 +0100
Subject: Use CPPFLAGS from the environment

---
 dlm_controld/Makefile | 4 ++--
 dlm_tool/Makefile     | 2 +-
 fence/Makefile        | 2 +-
 libdlm/Makefile       | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

--- a/dlm_controld/Makefile
+++ b/dlm_controld/Makefile
@@ -62,10 +62,10 @@
 all: $(LIB_TARGET) $(BIN_TARGET) $(LIB_PC)
 
 $(BIN_TARGET): $(BIN_SOURCE)
-	$(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(BIN_LDFLAGS) -o $@ -L.
+	$(CC) $(CPPFLAGS) $(BIN_SOURCE) $(BIN_CFLAGS) $(BIN_LDFLAGS) -o $@ -L.
 
 $(LIB_TARGET): $(LIB_SOURCE)
-	$(CC) $^ $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared -o $@ -Wl,-soname=$(LIB_SMAJOR)
+	$(CC) $(CPPFLAGS) $^ $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared -o $@ -Wl,-soname=$(LIB_SMAJOR)
 	ln -sf $(LIB_TARGET) $(LIB_SO)
 	ln -sf $(LIB_TARGET) $(LIB_SMAJOR)
 
--- a/dlm_tool/Makefile
+++ b/dlm_tool/Makefile
@@ -27,7 +27,7 @@
 all: $(BIN_TARGET)
 
 $(BIN_TARGET): $(BIN_SOURCE)
-	$(CC) $(BIN_SOURCE) $(CFLAGS) $(LDFLAGS) -o $@
+	$(CC) $(CPPFLAGS) $(BIN_SOURCE) $(CFLAGS) $(LDFLAGS) -o $@
 
 clean:
 	rm -f *.o *.so *.so.* $(BIN_TARGET)
--- a/fence/Makefile
+++ b/fence/Makefile
@@ -28,7 +28,7 @@
 all: $(BIN_TARGET)
 
 $(BIN_TARGET): $(BIN_SOURCE)
-	$(CC) $(BIN_SOURCE) $(CFLAGS) $(LDFLAGS) -o $@ -L.
+	$(CC) $(CPPFLAGS) $(BIN_SOURCE) $(CFLAGS) $(LDFLAGS) -o $@ -L.
 
 clean:
 	rm -f *.o *.so *.so.* $(BIN_TARGET)
--- a/libdlm/Makefile
+++ b/libdlm/Makefile
@@ -90,10 +90,10 @@
 all: $(LIB_TARGET) $(LLT_TARGET) $(LIB_PC) $(LLT_PC)
 
 $(LIB_O): $(SOURCE) 
-	$(CC) $< $(LIB_CFLAGS) -c -o $@
+	$(CC) $(CPPFLAGS) $< $(LIB_CFLAGS) -c -o $@
 
 $(LLT_O): $(SOURCE) 
-	$(CC) $< $(LLT_CFLAGS) -c -o $@
+	$(CC) $(CPPFLAGS) $< $(LLT_CFLAGS) -c -o $@
 
 $(LIB_TARGET): $(LIB_O)
 	$(CC) $^ $(LIB_LDFLAGS) -shared -o $@ -Wl,-soname=$(LIB_SMAJOR)
